<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>

<form id="myform"  method="post" action="javascript:alert('表单提交啦!')">
	<input type="text" size="25" maxlength="50" value="初始值">
	<textarea rows="5" cols="25">初始值</textarea>
</form>


<script>


var form = document.getElementById("myform");
var field1 = form.elements[0];
var field2 = form.elements[1];


field1.onfocus = function(){
	this.select();	
}
field2.onfocus = function(){
	this.select();	
}





</script>

</body>
</html>
